5.1
MEDIUM CVSS 4.0
CVE-2026-42795
Symlink Following in Hex Package Export Allows Embedding Files Outside Project Root
Description

Symlink following vulnerability in Gleam's Hex package export allows files outside the project root to be embedded in the generated package tarball. The file collection helpers (gleam_files, native_files, private_files) in compiler-cli/src/fs.rs use follow_links(true) when walking publishable directories such as src/ and priv/. The collected paths are added to the package archive via add_path_to_tar in compiler-cli/src/publish.rs without verifying that the resolved target remains within the project root. A symlink placed under a publishable directory will cause gleam export hex-tarball or gleam publish to embed the contents of the symlink target into the generated Hex package. An attacker with write access to the project repository can place a symlink in src/ or priv/ pointing to an arbitrary file. When a maintainer or CI pipeline runs gleam publish or gleam export hex-tarball, local files readable by the publisher (such as secrets, tokens, or SSH keys) are silently embedded into the published package artifact. This issue affects Gleam from 0.10.0-rc1 until 1.17.0.

INFO

Published Date :

June 2, 2026, 2:16 p.m.

Last Modified :

June 2, 2026, 4:16 p.m.

Remotely Exploit :

No

Source :

6b3ad84c-e1a6-4bf7-a703-f496b71e49db
Affected Products

The following products are affected by CVE-2026-42795 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

No affected product recoded yet

CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 4.0 MEDIUM 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
CVSS 4.0 MEDIUM 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
Solution
Update Gleam to version 1.17.0 or later to fix symlink following in package export.
  • Update Gleam to a version that fixes this issue.
  • Review published packages for embedded sensitive files.
  • Ensure symlinks are not used in package source directories.
References to Advisories, Solutions, and Tools
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2026-42795 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2026-42795 weaknesses.

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2026-42795 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2026-42795 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0

    Jun. 02, 2026

    Action Type Old Value New Value
    Added Reference https://github.com/gleam-lang/gleam/security/advisories/GHSA-qhh5-fg4c-8gqc
  • New CVE Received by 6b3ad84c-e1a6-4bf7-a703-f496b71e49db

    Jun. 02, 2026

    Action Type Old Value New Value
    Added Description Symlink following vulnerability in Gleam's Hex package export allows files outside the project root to be embedded in the generated package tarball. The file collection helpers (gleam_files, native_files, private_files) in compiler-cli/src/fs.rs use follow_links(true) when walking publishable directories such as src/ and priv/. The collected paths are added to the package archive via add_path_to_tar in compiler-cli/src/publish.rs without verifying that the resolved target remains within the project root. A symlink placed under a publishable directory will cause gleam export hex-tarball or gleam publish to embed the contents of the symlink target into the generated Hex package. An attacker with write access to the project repository can place a symlink in src/ or priv/ pointing to an arbitrary file. When a maintainer or CI pipeline runs gleam publish or gleam export hex-tarball, local files readable by the publisher (such as secrets, tokens, or SSH keys) are silently embedded into the published package artifact. This issue affects Gleam from 0.10.0-rc1 until 1.17.0.
    Added CVSS V4.0 AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
    Added CWE CWE-59
    Added Reference https://cna.erlef.org/cves/CVE-2026-42795.html
    Added Reference https://github.com/gleam-lang/gleam/commit/6435a5528b9ae0449e2f32be579641ec485f6866
    Added Reference https://github.com/gleam-lang/gleam/security/advisories/GHSA-qhh5-fg4c-8gqc
    Added Reference https://osv.dev/vulnerability/EEF-CVE-2026-42795
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.